﻿<UserControl x:Class="MvvmTwitter.Views.PrettierDisplayView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" mc:Ignorable="d" 
             d:DesignHeight="700" d:DesignWidth="800">
    <Grid>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF17B6EB" Offset="0"/>
                <GradientStop Color="#FFA7E4FF" Offset="1"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="324.135"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Image Margin="8,0,0,144" Source="/MvvmTwitter;component/Resources/twitter_3_512.png" Stretch="Fill" Height="311" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="311.135"/>
        <TextBox Text="{Binding SearchString}" Height="26" Margin="49,0,43,118" TextWrapping="Wrap" VerticalAlignment="Bottom"/>

        <ListView x:Name="lstTweets" VerticalAlignment="Stretch" ItemsSource="{Binding TweetSearchTweets, Mode=OneWay}" Grid.Column="1" Margin="8,8,8,0" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="White" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Selector.SelectionChanged="lstTweets_SelectionChanged">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Grid VerticalAlignment="Top" Cursor="Hand" Margin="5,5,5,5">
                        <Grid.Effect>
                            <DropShadowEffect BlurRadius="13" ShadowDepth="1" Color="#FF578EA4"/>
                        </Grid.Effect>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="14"/>
                        </Grid.RowDefinitions>
                        <Rectangle Fill="White" Stroke="#FF2CBBF0" RadiusX="10" RadiusY="10"/>
                        <Path Fill="White" Stretch="Fill" Stroke="#FF2CBBF0" HorizontalAlignment="Left" Margin="30,-5.597,0,0" Width="25" Grid.Row="1" Data="M22.166642,154.45381 L29.999666,187.66699 40.791059,154.54395" Height="19.6" VerticalAlignment="Top" RenderTransformOrigin="-0.685,0.49"/>
                        <Rectangle Fill="White" RadiusX="10" RadiusY="10" Margin="1"/>
                        <DockPanel Margin="5,5,5,5">
                            <Image Source="{Binding Image}" Height="50" Width="50" DockPanel.Dock="Left" />

                            <StackPanel Margin="5,0,0,0" >
                                <TextBlock FontSize="13" Text="{Binding Author.Name}" FontWeight="Bold" Foreground="Black" />
                                <TextBlock FontSize="13" Text="{Binding Content}" Foreground="Black" />
                            </StackPanel>
                        </DockPanel>

                        <Grid.Triggers>
                            <EventTrigger RoutedEvent="Control.Loaded">
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation To="1" Duration="0:0:0.5" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger>
                        </Grid.Triggers>
                    </Grid>
                </DataTemplate>
            </ListView.ItemTemplate>
            <ListView.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
                        <i:Interaction.Behaviors>
                            <ei:FluidMoveBehavior AppliesTo="Children" Duration="00:00:01">
                                <ei:FluidMoveBehavior.EaseX>
                                    <CircleEase EasingMode="EaseOut"/>
                                </ei:FluidMoveBehavior.EaseX>
                            </ei:FluidMoveBehavior>
                        </i:Interaction.Behaviors>
                    </WrapPanel>
                </ItemsPanelTemplate>
            </ListView.ItemsPanel>
        </ListView>
        <Button Command="{Binding OnSearchClick}" Content="Search" Height="25" Margin="122,0,126.135,89" VerticalAlignment="Bottom" IsDefault="True" />
        <Button Command="{Binding OnSwitchToUgly}" Content="Switch To Ugly" Height="25" Width="150" Margin="0,0,0,20" VerticalAlignment="Bottom" />
    </Grid>
</UserControl>
